/**
 * Created by Veronica on 2017/3/25.
 */

/*格式化日期*/
package app13;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;

public class DateTimeFormatterDemo1 {
    public static void main(String[] args) {
        DateTimeFormatter formatter1 = DateTimeFormatter
                .ofLocalizedDateTime(FormatStyle.MEDIUM);
        //.ofofLocalizedDate只显示日期，不显示时间
        LocalDateTime example = LocalDateTime.of(
                2000,3,19,10,56,59);
        System.out.println("Format 1:" + example
                .format(formatter1));
        DateTimeFormatter formatter2 = DateTimeFormatter
                .ofPattern("MMM dd,yyyy HH:mm:ss");
        System.out.println("Format 2:" + example
                .format(formatter2));
    }
}
